// Το σκηνικό αποτελείται από:
//
//	Παίκτες		Πρόκειται για λίστα δεικτοδοτημένη με το login name του παίκτη
//			που για κάποιο λόγο πρέπει να τους έχουμε πρόχειρους. Μερικοί
//			από τους λόγους αυτούς είναι: ο παίκτης είναι ή ήταν πρόσφατα
//			online, ο παίκτης φαίνεται να παίζει σε κάποιο τραπέζι κλπ.
//
//	Συνεδρίες	Πρόκειται για λίστα δεικτοδοτημένη με το login name του παίκτη
//			και περιλαμβάνει όλους τους online παίκτες. Η λίστα περιέχει
//			στοιχεία επικοινωνίας του παίκτη με τον server (IP, κλειδί,
//			αίτημα δεδομένων, κανάλι απάντησης κλπ) και τα στοιχεία θέσης
//			του παίκτη (κωδικός καφενείου, κωδικός τραπεζιού, θέση και τρόπος
//			συμμετοχής στο τραπέζι). Οι συνεδρίες αφαιρούνται από τη λίστα είτε
//			κατά την ρητή έξοδο του παίκτη από το πρόγραμμα, είτε μέσω περιπολικής
//			διαδικασίας εκκαθάρισης που κλείνει συνεδρίες που δείχνουν να είναι
//			αδρανείς για «μεγάλο» χρονικό διάστημα.
//
//	Καφενεία	Πρόκειται για λίστα όλων των υφιστάμενων καφενείων δεικτοδοτημένη
//			με τον κωδικό καφενείου.
//
//	Συζήτηση	Πρόκειται για λίστα δεικτοδοτημένη με τον κωδικό σχολίου και αφορά
//			στη δημόσια συζήτηση εκτός συγκεκριμένου καφενείου και εκτός συγκεκριμένου
//			τραπεζιού (lobby).
//
// Υπάρχει πλήρες σκηνικό στον skiser και υποσύνολα σε κάθε client. Τα σκηνικά των clients
// περιλαμβάνουν εκείνα τα στοιχεία του σκηνικού που αφορούν στον αντίστοιχο παίκτη.

Skiniko = function(props) {
	this.pektis = {};
	this.sinedria = {};
	this.kafenio = {};
	this.sizitisi = {};
	this.trapezi = {};
	Globals.initObject(this, props);
};

Skiniko.prototype.skinikoPektisSet = function(pektis) {
	this.pektis[pektis.pektisLoginGet()] = pektis;
	return this;
};

Skiniko.prototype.skinikoPektisGet = function(login) {
	return this.pektis[login];
};

Skiniko.prototype.skinikoPektisDelete = function(login) {
	delete this.pektis[login];
	return this;
};

Skiniko.prototype.skinikoPektisWalk = function(callback, dir, sort) {
	var keys = [];

	if (!dir) {
		Globals.walk(this.pektis, function(login, pektis) {
			callback.call(pektis);
		});

		return this;
	}

	this.skinikoPektisWalk(function() {
		keys.push(this);
	});

	if (sort === undefined)
	sort = function(a, b) {
		return a.login.localeCompare(b.login) * dir;
	};
	keys.sort(sort);

	Globals.awalk(keys, function(i, pektis) {
		callback.call(pektis);
	});

	return this;
};

Skiniko.prototype.skinikoKafenioSet = function(kafenio) {
	this.kafenio[kafenio.kafenioKodikosGet()] = kafenio;
	return this;
};

Skiniko.prototype.skinikoKafenioGet = function(kodikos) {
	return this.kafenio[kodikos];
};

Skiniko.prototype.skinikoKafenioWalk = function(callback, dir, sort) {
	var keys = [];

	if (!dir) {
		Globals.walk(this.kafenio, function(i, kafenio) {
			callback.call(kafenio);
		});

		return this;
	}

	this.skinikoKafenioWalk(function() {
		keys.push(this);
	});

	if (sort === undefined)
	sort = function(a, b) {
		if (a.kodikos < b.kodikos)
		return (-1) * dir;

		if (a.kodikos > b.kodikos)
		return 1 * dir;

		return 0;
	};
	keys.sort(sort);

	Globals.awalk(keys, function(i, kafenio) {
		callback.call(kafenio);
	});

	return this;
};

Skiniko.prototype.skinikoDiapisteSet = function(diapiste) {
	var kafenio;

	kafenio = this.skinikoKafenioGet(diapiste.diapisteKafenioGet());
	if (!kafenio)
	return this;

	kafenio.kafenioDiapisteSet(diapiste);
	return this;
};

Skiniko.prototype.skinikoTrapeziSet = function(trapezi) {
	var kodikos, kafenio;

	kodikos = trapezi.trapeziKodikosGet();

	kafenio = this.skinikoKafenioGet(trapezi.trapeziKafenioGet());
	if (kafenio)
	kafenio.kafenioTrapeziSet[kodikos] = trapezi;

	this.trapezi[kodikos] = trapezi;
	return this;
};

Skiniko.prototype.skinikoTrapeziGet = function(kodikos) {
	return this.trapezi[kodikos];
};

Skiniko.prototype.skinikoTrapeziWalk = function(callback, dir, sort) {
	var keys = [];

	if (!dir) {
		Globals.walk(this.trapezi, function(i, trapezi) {
			callback.call(trapezi);
		});

		return this;
	}

	this.skinikoTrapeziWalk(function() {
		keys.push(this);
	});

	if (sort === undefined)
	sort = function(a, b) {
		if (a.kodikos < b.kodikos)
		return (-1) * dir;

		if (a.kodikos > b.kodikos)
		return 1 * dir;

		return 0;
	};
	keys.sort(sort);

	Globals.awalk(keys, function(i, trapezi) {
		callback.call(trapezi);
	});

	return this;
};

Skiniko.prototype.skinikoSinedriaSet = function(sinedria) {
	this.sinedria[sinedria.sinedriaPektisGet()] = sinedria;
	return this;
};

Skiniko.prototype.skinikoSinedriaGet = function(login) {
	return this.sinedria[login];
};

Skiniko.prototype.skinikoSinedriaDelete = function(login) {
	delete this.sinedria[login];
	return this;
};

Skiniko.prototype.skinikoSinedriaWalk = function(callback, dir, sort) {
	var keys = [];

	if (!dir) {
		Globals.walk(this.sinedria, function(login, sinedria) {
			callback.call(sinedria);
		});

		return this;
	}

	this.skinikoSinedriaWalk(function() {
		keys.push(this);
	});

	if (sort === undefined)
	sort = function(a, b) {
		if (a.isodos < b.isodos)
		return (-1) * dir;

		if (a.isodos > b.isodos)
		return 1 * dir;

		return 0;
	};
	keys.sort(sort);

	Globals.awalk(keys, function(i, sinedria) {
		callback.call(sinedria);
	});

	return this;
};

Skiniko.prototype.skinikoSizitisiSet = function(sizitisi) {
	this.sizitisi[sizitisi.kodikos] = sizitisi;
	sizitisi.skiniko = this;
	return this;
};

Skiniko.prototype.skinikoSizitisiGet = function(kodikos) {
	return this.sizitisi[kodikos];
};

Skiniko.prototype.skinikoSizitisiDelete = function(kodikos) {
	delete this.sizitisi[kodikos];
	return this;
};

Skiniko.prototype.skinikoSizitisiWalk = function(callback, dir) {
	var keys = [];

	if (!dir) {
		Globals.walk(this.sizitisi, function(kodikos, sizitisi) {
			callback.call(sizitisi);
		});

		return this;
	}

	this.skinikoSizitisiWalk(function() {
		keys.push(this);
	});

	keys.sort(function(a, b) {
		if (a.kodikos < b.kodikos) return (-1) * dir;
		if (a.kodikos > b.kodikos) return 1 * dir;
		return 0;
	});

	Globals.awalk(keys, function(i, sizitisi) {
		callback.call(sizitisi);
	});

	return this;
};

Skiniko.prototype.skinikoProsklisiSet = function(prosklisi) {
	var i, p, trapezi, apo, pros;

	trapezi = prosklisi.prosklisiTrapeziGet();
	apo = prosklisi.prosklisiApoGet();
	pros = prosklisi.prosklisiProsGet();

	for (i in this.prosklisi) {
		p = this.prosklisi[i];
		if (p.prosklisiTrapeziGet() != trapezi) continue;
		if (p.prosklisiApoGet() != apo) continue;
		if (p.prosklisiProsGet() != pros) continue;

		this.skinikoProsklisiDelete(i);
		break;
	}

	this.prosklisi[prosklisi.prosklisiKodikosGet()] = prosklisi;
	prosklisi.prosklisiSkinikoSet(this);
	return this;
};

Skiniko.prototype.skinikoProsklisiGet = function(kodikos) {
	return this.prosklisi[kodikos];
};

Skiniko.prototype.skinikoProsklisiDelete = function(kodikos) {
	delete this.prosklisi[kodikos];
	return this;
};

Skiniko.prototype.skinikoProsklisiWalk = function(callback) {
	Globals.walk(this.prosklisi, function(kodikos, prosklisi) {
		callback.call(prosklisi);
	});

	return this;
}

Skiniko.prototype.skinikoKinisiProcess = function(kinisi) {
	var proc;

console.log('skinikoKinisiProcess', kinisi);
	proc = 'processKinisiAnte' + kinisi.idos;
	if (typeof this[proc] === 'function')
	this[proc](kinisi.data);

	proc = 'processKinisi' + kinisi.idos;
	if (typeof this[proc] === 'function')
	this[proc](kinisi.data);

	proc = 'processKinisiPost' + kinisi.idos;
console.log(proc);
	if (typeof this[proc] === 'function')
	this[proc](kinisi.data);

	return this;
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

Pektis = function(props) {
	this.peparam = {};
	this.profinfo = {};
	this.sxesi = {};
	Globals.initObject(this, props);
};

Pektis.prototype.pektisLoginGet = function() {
	return this.login;
};

Pektis.prototype.pektisOnomaGet = function() {
	return this.onoma;
};

Pektis.prototype.pektisPollSet = function(ts) {
	if (ts === undefined)
	ts = Globals.toraServer();

	this.poll = ts;
	return this;
};

Pektis.prototype.pektisPeparamSet = function() {
	if (arguments.length === 1)
	this.peparam[arguments[0].peparamParamGet()] = arguments[0].peparamTimiGet();

	else if (arguments.length === 2)
	this.peparam[arguments[0]] = arguments[1];

	else
	throw "invalid arguments";

	return this;
};

Pektis.prototype.pektisPeparamGet = function(param) {
	return this.peparam[param];
};

Pektis.prototype.pektisPeparamWalk = function(callback) {
	Globals.walk(this.peparam, function(param, timi) {
		callback(param, timi);
	});
	return this;
};

Pektis.prototype.pektisAxiomaGet = function() {
	var axioma = this.pektisPeparamGet('ΑΞΙΩΜΑ');
	if (!axioma) axioma = 'ΘΑΜΩΝΑΣ';
	return axioma;
};

Pektis.prototype.pektisAxiomaRankGet = function() {
	var axioma = this.pektisAxiomaGet();
	return(Peparam.axiomaRank.hasOwnProperty(axioma) ? Peparam.axiomaRank[axioma] : 0);
};

Pektis.prototype.pektisIsThamonas = function() {
	return(this.pektisAxiomaRankGet() >= Peparam.axiomaRank['ΘΑΜΩΝΑΣ']);
};

Pektis.prototype.pektisIsVip = function() {
	return(this.pektisAxiomaRankGet() >= Peparam.axiomaRank['VIP']);
};

Pektis.prototype.pektisOxiVip = function() {
	return !this.pektisIsVip();
};

Pektis.prototype.pektisIsEpoptis = function() {
	return(this.pektisAxiomaRankGet() >= Peparam.axiomaRank['ΕΠΟΠΤΗΣ']);
};

Pektis.prototype.pektisOxiEpoptis = function() {
	return !this.pektisIsEpoptis();
};

Pektis.prototype.pektisIsDiaxiristis = function() {
	return(this.pektisAxiomaRankGet() >= Peparam.axiomaRank['ΔΙΑΧΕΙΡΙΣΤΗΣ']);
};

Pektis.prototype.pektisOxiDiaxiristis = function() {
	return !this.pektisIsDiaxiristis();
};

Pektis.prototype.pektisIsAdministrator = function() {
	return(this.pektisAxiomaRankGet() >= Peparam.axiomaRank['ADMINISTRATOR']);
};

Pektis.prototype.pektisOxiAdminstrator = function() {
	return !this.pektisIsAdminstrator();
};

Pektis.prototype.pektisIsApasxolimenos = function() {
	return(this.pektisPeparamGet('ΚΑΤΑΣΤΑΣΗ') === 'ΑΠΑΣΧΟΛΗΜΕΝΟΣ');
};

Pektis.prototype.pektisIsDiathesimos = function() {
	return !this.pektisIsApasxolimenos();
};

Pektis.prototype.pektisPlatiGet = function() {
	var plati = this.pektisPeparamGet('ΠΛΑΤΗ');
	return(plati != 'ΚΟΚΚΙΝΟ' ? 'ΜΠΛΕ' : plati);
};

Pektis.prototype.pektisPlatiRBGet = function() {
	return(this.pektisPlatiGet() == 'ΚΟΚΚΙΝΟ' ? 'R' : 'B');
};

Pektis.prototype.pektisIsDeveloper = function() {
	var developer = this.pektisPeparamGet('DEVELOPER');
	if (!developer) return false;
	return developer.isNai();
};

Pektis.prototype.pektisOxiDeveloper = function() {
	return !this.pektisIsDeveloper();
};

Pektis.prototype.pektisProfinfoSet = function() {
	if (arguments.length === 1)
	this.profinfo[arguments[0].profinfoSxoliastisGet()] = arguments[0].profinfoKimenoGet();

	else if (arguments.length === 2)
	this.profinfo[arguments[0]] = arguments[1];

	else
	throw "invalid arguments";

	return this;
};

Pektis.prototype.pektisProfinfoGet = function(pektis) {
	return this.profinfo[pektis];
};

Pektis.prototype.pektisProfinfoWalk = function(callback) {
	Globals.walk(this.profinfo, function(sxetizomenos, profinfo) {
		callback(sxetizomenos, profinfo);
	});
	return this;
};

Pektis.prototype.pektisSxesiSet = function(sxetizomenos, sxesi) {
	if (sxesi) this.sxesi[sxetizomenos] = sxesi;
	else this.pektisSxesiSetAsxetos(sxetizomenos);
	return this;
};

Pektis.prototype.pektisSxesiSetFilos = function(sxetizomenos) {
	this.sxesi[sxetizomenos] = 'ΦΙΛΟΣ';
	return this;
};

Pektis.prototype.pektisSxesiSetApoklismenos = function(sxetizomenos) {
	this.sxesi[sxetizomenos] = 'ΑΠΟΚΛΕΙΣΜΕΝΟΣ';
	return this;
};

Pektis.prototype.pektisSxesiSetAsxetos = function(sxetizomenos) {
	delete this.sxesi[sxetizomenos];
	return this;
};

Pektis.prototype.pektisSxesiGet = function(sxetizomenos) {
	return this.sxesi[sxetizomenos];
};

Pektis.prototype.pektisSxesiWalk = function(callback) {
	Globals.walk(this.sxesi, function(sxetizomenos, sxesi) {
		callback(sxetizomenos, sxesi);
	});
	return this;
};

Pektis.prototype.pektisIsFilos = function(sxetizomenos) {
	return(this.pektisSxesiGet(sxetizomenos) === 'ΦΙΛΟΣ');
};

Pektis.prototype.pektisOxiFilos = function(sxetizomenos) {
	return !this.pektisIsFilos(sxetizomenos);
};

Pektis.prototype.pektisIsApoklismenos = function(sxetizomenos) {
	return(this.pektisSxesiGet(sxetizomenos) === 'ΑΠΟΚΛΕΙΣΜΕΝΟΣ');
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

Peparam = function(props) {
	Globals.initObject(this, props);
};

Peparam.prototype.peparamParamGet = function() {
	return this.param;
};

Peparam.prototype.peparamTimiGet = function() {
	return this.timi;
};

Peparam.axiomaRank = {
	ΘΑΜΩΝΑΣ:	0,
	VIP:		1,
	ΕΠΟΠΤΗΣ:	2,
	ΔΙΑΧΕΙΡΙΣΤΗΣ:	3,
	ADMINISTRATOR:	4,
	ΠΡΟΕΔΡΟΣ:	5,
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

Profinfo = function(props) {
	Globals.initObject(this, props);
};

Profinfo.prototype.profinfoPektisGet = function() {
	return this.pektis;
};

Profinfo.prototype.profinfoSxoliastisGet = function() {
	return this.sxoliastis;
};

Profinfo.prototype.profinfoKimenoGet = function() {
	return this.kimeno;
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

Sxesi = function(props) {
	Globals.initObject(this, props);
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

Kafenio = function(props) {
	this.trapezi = {};
	this.sizitisi = {};
	this.diapiste = {};
	Globals.initObject(this, props);
};

Kafenio.prototype.kafenioKodikosSet = function(kodikos) {
	this.kodikos = kodikos;
	return this;
};

Kafenio.prototype.kafenioKodikosGet = function() {
	return this.kodikos;
};

Kafenio.prototype.kafenioOnomasiaSet = function(onomasia) {
	this.onomasia = onomasia;
	return this;
};

Kafenio.prototype.kafenioOnomasiaGet = function() {
	return this.onomasia;
};

Kafenio.prototype.kafenioDimiourgosSet = function(dimiourgos) {
	this.dimiourgos = dimiourgos;
	return this;
};

Kafenio.prototype.kafenioDimiourgosGet = function() {
	return this.dimiourgos;
};

Kafenio.prototype.kafenioTrapeziSet = function(trapezi) {
	this.trapezi[trapezi.trapeziKodikosGet()] = trapezi;
	return this;
};

Kafenio.prototype.kafenioTrapeziGet = function(kodikos) {
	return this.trapezi[kodikos];
};

Kafenio.prototype.kafenioTrapeziWalk = function(callback, dir, sort) {
	var keys = [];

	if (!dir) {
		Globals.walk(this.trapezi, function(kodikos, trapezi) {
			callback.call(trapezi);
		});

		return this;
	}

	this.kafenioTrapeziWalk(function() {
		keys.push(this);
	});

	if (sort === undefined)
	sort = function(a, b) {
		if (a.kodikos < b.kodikos)
		return (-1) * dir;

		if (a.kodikos > b.kodikos)
		return 1 * dir;

		return 0;
	};
	keys.sort(sort);

	Globals.awalk(keys, function(i, trapezi) {
		callback.call(trapezi);
	});

	return this;
};

Kafenio.prototype.kafenioIsPrive = function() {
	return this.prive;
};

Kafenio.prototype.kafenioIsDimosio = function() {
	return !this.kafenioIsPrive();
};

Kafenio.prototype.kafenioDiapisteSet = function(diapiste) {
	var pektis;

	pektis = diapiste.diapistePektisGet();
	if (!pektis)
	return this;

	this.diapiste[pektis] = diapiste.diapisteEpidosiGet();
	return this;
};

Kafenio.prototype.kafenioDiapisteGet = function(pektis) {
	return this.diapiste[pektis];
};

Kafenio.prototype.kafenioDiapisteDelete = function(pektis) {
	delete this.diapiste[pektis];
	return this;
};

Kafenio.prototype.kafenioIsDiapiste = function(login) {
	if (this.kafenioIsDimosio())
	return true;

	if (login === this.kafenioDimiourgosGet())
	return true;

	return this.diapiste[login];
};

Kafenio.prototype.kafenioOxiDiapiste = function(login) {
	return !this.kafenioIsDiapiste(login);
};

Kafenio.prototype.kafenioDiapisteWalk = function(callback) {
	var kafenio = this;

	Globals.walk(this.diapiste, function(pektis, epidosi) {
		callback.call(new Diapiste({
			kafenio: kafenio.kafenioKodikosGet(),
			pektis: pektis,
			epidosi: epidosi,
		}));
	});

	return this;
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

Diapiste = function(props) {
	Globals.initObject(this, props);
};

Diapiste.prototype.diapisteKafenioSet = function(kafenio) {
	this.kafenio = kafenio;
	return this;
};

Diapiste.prototype.diapisteKafenioGet = function() {
	return this.kafenio;
};

Diapiste.prototype.diapistePektisSet = function(pektis) {
	this.pektis = pektis;
	return this;
};

Diapiste.prototype.diapistePektisGet = function() {
	return this.pektis;
};

Diapiste.prototype.diapisteEpidosiSet = function(epidosi) {
	this.epidosi = epidosi;
	return this;
};

Diapiste.prototype.diapisteEpidosiGet = function() {
	return this.epidosi;
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

Sinedria = function(props) {
	Globals.initObject(this, props);
};

Sinedria.prototype.sinedriaPektisSet = function(pektis) {
	this.pektis = pektis;
	return this;
};

Sinedria.prototype.sinedriaPektisGet = function() {
	return this.pektis;
};

Sinedria.prototype.sinedriaIpSet = function(ip) {
	this.ip = ip;
	return this;
};

Sinedria.prototype.sinedriaIpGet = function() {
	return this.ip;
};

Sinedria.prototype.sinedriaKafenioSet = function(kafenio) {
	this.kafenio = kafenio;
	return this;
};

Sinedria.prototype.sinedriaKafenioGet = function() {
	return this.kafenio;
};

Sinedria.prototype.sinedriaTrapeziSet = function(trapezi) {
	this.trapezi = trapezi;
	return this;
};

Sinedria.prototype.sinedriaTrapeziGet = function() {
	return this.trapezi;
};

Sinedria.prototype.sinedriaThesiSet = function(thesi) {
	this.thesi = thesi;
	return this;
};

Sinedria.prototype.sinedriaThesiGet = function() {
	return this.thesi;
};

Sinedria.prototype.sinedriaSimetoxiSet = function(simetoxi) {
	this.simetoxi = simetoxi;
	return this;
};

Sinedria.prototype.sinedriaSimetoxiGet = function() {
	return this.simetoxi;
};

Sinedria.prototype.sinedriaPollSet = function(ts) {
	if (ts === undefined)
	ts = Globals.toraServer();

	this.poll = ts;
	return this;
};

Sinedria.prototype.sinedriaPollGet = function() {
	return this.poll;
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

Trapezi = function(props) {
	this.trparam = {};
	this.pektis = {};
	this.apodoxi = {};
	this.dianomi = {};
	this.dianomiArray = [];
	this.sizitisi = {};
	Globals.initObject(this, props);
};

Trapezi.prototype.trapeziKodikosSet = function(kodikos) {
	this.kodikos = kodikos;
	return this;
};

Trapezi.prototype.trapeziKodikosGet = function() {
	return this.kodikos;
};

Trapezi.prototype.trapeziKafenioSet = function(kafenio) {
	this.kafenio = kafenio;
	return this;
};

Trapezi.prototype.trapeziKafenioGet = function() {
	return this.kafenio;
};

Trapezi.prototype.trapeziTrparamSet = function() {
	if (arguments.length === 1)
	this.trparam[arguments[0].trparamTaramGet()] = arguments[0].trparamTimiGet();

	else if (arguments.length === 2)
	this.trparam[arguments[0]] = arguments[1];

	else
	throw "invalid arguments";

	return this;
};

Trapezi.prototype.trapeziTrparamGet = function(param) {
	return this.trparam[param];
};

Trapezi.prototype.trapeziDianomiWalk = function(callback, dir) {
	var i;

	if (dir > 0) {
		for (i = 0; i < this.dianomiArray.length; i++) {
			callback.call(this.dianomiArray[i]);
		}
	}
	else if (dir < 0) {
		for (i = this.dianomiArray.length - 1; i >= 0; i--) {
			callback.call(this.dianomiArray[i]);
		}
	}
	else {
		for (i in this.dianomi) {
			callback.call(this.dianomi[i]);
		}
	}

	return this;
};

Trapezi.prototype.trapeziPektisSet = function(thesi, login) {
	this.pektis[thesi] = login;
	return this;
};

Trapezi.prototype.trapeziPektisGet = function(thesi) {
	return this.pektis[thesi];
};

Trapezi.prototype.trapeziApodoxiSet = function(thesi, apodoxi) {
	this.apodoxi[thesi] = apodoxi;
	return this;
};

Trapezi.prototype.trapeziApodoxiGet = function(thesi) {
	return this.apodoxi[thesi];
};

Trapezi.prototype.trapeziThesiWalk = function(callback) {
	var trapezi = this;

	Vida.thesiWalk(function(thesi) {
		callback.call(trapezi, thesi);
	});

	return this;
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

Trparam = function(props) {
	Globals.initObject(this, props);
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

Sinthesi = function(props) {
	Globals.initObject(this, props);
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

Simetoxi = function(props) {
	Globals.initObject(this, props);
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

Prosklisi = function(props) {
	Globals.initObject(this, props);
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

Dianomi = function(props) {
	this.energia = {};
	this.energiaArray = [];
	Globals.initObject(this, props);
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

Energia = function(props) {
	Globals.initObject(this, props);
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

Sizitisi = function(props) {
	Globals.initObject(this, props);
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

//	k = new Kinisi('PK');
//
//	k = new Kinisi('PK', {
//		login: login,
//		onoma: onoma,
//	};
//
//	k = new Kinisi({
//		idos: 'PK',
//		data: {
//			login: login,
//			onoma: onoma,
//		}
//	});

Kinisi = function() {
	var prop = {};

	if (arguments.length === 2) {
		prop.idos = arguments[0];
		prop.data = arguments[1];
	}
	else {
		if (typeof(arguments[0]) === 'string')
		prop = { idos: arguments[0] };

		else
		prop = arguments[0];
	}

	Globals.initObject(this, prop);
	if (!this.hasOwnProperty('data'))
	this.data = {};
};

Kinisi.prototype.kinisiIdosGet = function() {
	return this.idos;
};

Kinisi.prototype.kinisiDataGet = function(tag) {
	return(tag === undefined ? this.data : this.data[tag]);
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@

skiniko = new Skiniko();
